package hellotabwidget.pack;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;

public class MyView extends View {
	
	static int A;
	int B;
	int C = 0;
	public MyView(Context context) {
		super(context);
		
	}

	public MyView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public MyView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	protected void onDraw(Canvas c) {
		super.onDraw(c);

		Paint paint = new Paint();
		paint.setStyle(Paint.Style.FILL);
		// make the entire canvas white
		paint.setColor(Color.BLACK);
		c.drawPaint(paint);

		// draw a red rectangle paint.setAntiAlias(true);
		
		
		
		//Paint paint1 = new Paint();
		paint.setColor(Color.GREEN);
		paint.setStyle(Paint.Style.FILL);
		RectF gf = new RectF(50, 75, 340, 90);
		c.drawRect(gf, paint);
		paint.setStyle(Paint.Style.FILL);
		paint.setColor(Color.YELLOW);
		paint.setStyle(Paint.Style.FILL);
		RectF cf = new RectF(50, 75, A, 90);
		c.drawRect(cf, paint);
		
		
		
		paint.setColor(Color.GREEN);
		paint.setStyle(Paint.Style.FILL);
		RectF vf = new RectF(340, 140, 40, 155);
		c.drawRect(vf, paint);
		paint.setColor(Color.YELLOW);
		paint.setStyle(Paint.Style.FILL);
		RectF nf = new RectF(50, 140, B, 155);
		c.drawRect(nf, paint);
		
		paint.setColor(Color.GREEN);
		paint.setStyle(Paint.Style.FILL);
		RectF bf = new RectF(340, 205, 40, 220);
		c.drawRect(bf, paint);
		
		paint.setColor(Color.YELLOW);
		paint.setStyle(Paint.Style.FILL);
		RectF rf = new RectF(100, 205, C, 220);
		c.drawRect(rf, paint);

		c.drawText("Food", 40, 65, paint);
		c.drawText("Entertainment", 40, 130, paint);
		c.drawText("Cloth", 40, 195, paint);
	}
	
	public static void setA(int a){
		A = a;
		
		
	}
	public void setB(int b){
		this.B = b;
	}
	public void setC(int c){
		this.C = c;
	}
}
